package be.kdg.bombermanunlimited.server.objects.finalclasses;

import java.rmi.RemoteException;
import java.util.Random;
/**
 * nieuw type wall, dat ontplofbaar is.
 * @author pieter
 *
 */
public class BreakableWall extends Wall {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2722268427807593699L;
	private boolean hasPowerUp;

	public BreakableWall(int powerupChance) throws RemoteException {
		super();
		Random r = new Random();
		if (r.nextInt(100) <= powerupChance) {
			this.hasPowerUp = true;
		}
	}

	@Override
	public String toString() {
		return "BreakableWall [hasPowerUp=" + hasPowerUp + "]";
	}

	@Override
	public boolean isBlowable() {
		return true;
	}

	public boolean hasPowerup() {
		return this.hasPowerUp;
	}

	public String AsciiMap() throws RemoteException {
		if (hasPowerUp)
			return "O";
		else
			return "X";
	}
	
	public TileType getType() throws RemoteException {
		return TileType.BreakableWall;
	}

	public boolean isWalkableLocalCall() {
		return false;
	}
}
